/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package query;

/**
 *
 * @author Gonzalo
 */
public class Operation {
    String op;

    public Operation(String o){
        op=o;
    }

    public boolean isConverse(){
        return op.compareTo("^")==0;
    }
    public boolean isKleene(){
        return op.compareTo("*")==0;
    }
    public boolean isNesting(){
        return op.compareTo("?")==0;
    }
    public boolean isNot(){
        return op.compareTo("~")==0;
    }
    public boolean isUnary(){
        return isConverse() || isKleene() || isNesting() || isNot();
    }


    public boolean isConcat(){
        return op.compareTo(".")==0;
    }
    public boolean isOr(){
        return op.compareTo("+")==0;
    }
    public boolean isAnd(){
        return op.compareTo("&")==0;
    }
    public boolean isMinus(){
        return op.compareTo("-")==0;
    }
    public boolean isParallel(){
        return op.compareTo("|")==0;
    }
    public boolean isBinary(){
        return isConcat() || isOr() || isAnd() || isMinus() || isParallel();
    }

    public String print(){
        return op;
    }
}
